﻿using System;
using Framework;

namespace Enterprise.Admin.Handle
{
    /// <summary>
    /// 修改应聘资料
    /// </summary>
    public partial class EditCandidates : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            object result;
            try
            {
                var id = Fq("CoCandidatesId").SafeToInt();
                string post = Fq("CoPost").SafeToString();
                string workExperience = Fq("CoWorkExperience").SafeToString();
                string education = Fq("CoEducation").SafeToString();
                string age = Fq("CoAge").SafeToString();
                DateTime date = Fq("CoDate").SafeToDateTime();
                string language = Fq("CoLanguage").SafeToString();
                string email = Fq("CoEmail").SafeToString();
                string name = Fq("CoName").SafeToString();
                string mobile = Fq("CoMobile").SafeToString();
                string qq = Fq("CoQq").SafeToString();
                string phone = Fq("CoPhone").SafeToString();
                string summary = Fq("CoSummary").SafeToString();
                string identNumber = Fq("CoIdentNumber").SafeToString();
                string workHistory = Fq("CoWorkHistory").SafeToString();
                string sex = Fq("CoSex").SafeToString();
                var candidatesService = new CandidatesService();
                candidatesService.Edit(id, post, workExperience, education, age,
                                       date, language, email, name,
                                       mobile, qq, phone, summary, identNumber,
                                       workHistory, sex);
                result = new { state = true, message = "修改成功" };
            }
            catch (Exception ex)
            {
                result = new { state = false, message = ex.Message };
            }
            Json(result);
        }
    }
}